inherited fmPodotchCommon: TfmPodotchCommon
  Left = 259
  Top = 107
  Width = 1006
  Height = 880
  Caption = #1055#1086#1076#1086#1090#1095#1077#1090
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 819
    Width = 998
  end
  inherited Panel1: TPanel
    Width = 998
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 828
    end
    inherited BitBtn2: TBitBtn
      Left = 916
    end
  end
  object dbgClients: TcxGrid [2]
    Left = 0
    Top = 74
    Width = 998
    Height = 464
    Align = alTop
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    object tvPodotch: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'BALANCE'
          Column = tvPodotchBALANCE
          DisplayText = #1054#1073#1097'. '#1089#1091#1084#1084#1072
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
      NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.CellSelect = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object tvPodotchRPTIMEENTER: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1079#1072#1074#1077#1076'.'
        DataBinding.FieldName = 'RPTIMEENTER'
        Width = 120
      end
      object tvPodotchRPDATE: TcxGridDBColumn
        Caption = #1044#1072#1090#1072
        DataBinding.FieldName = 'RPDATE'
        SortIndex = 1
        SortOrder = soAscending
        Width = 80
      end
      object tvPodotchFIO: TcxGridDBColumn
        Caption = #1055#1083#1072#1090#1077#1083#1100#1097#1080#1082'/'#1055#1086#1083#1091#1095#1072#1090#1077#1083#1100
        DataBinding.FieldName = 'FIO'
        SortIndex = 0
        SortOrder = soAscending
        Width = 147
      end
      object tvPodotchDEBET: TcxGridDBColumn
        Caption = #1055#1086#1089#1090#1091#1087#1080#1083#1086
        DataBinding.FieldName = 'DEBET'
        Width = 60
      end
      object tvPodotchKREDIT: TcxGridDBColumn
        Caption = #1054#1090#1076#1072#1085#1086
        DataBinding.FieldName = 'KREDIT'
        Width = 69
      end
      object tvPodotchBALANCE: TcxGridDBColumn
        Caption = #1041#1072#1083#1072#1085#1089' '#1087#1086' '#1086#1087#1077#1088'.'
        DataBinding.FieldName = 'BALANCE'
        Width = 138
      end
      object tvPodotchBALANCE_PREV: TcxGridDBColumn
        Caption = #1041#1072#1083#1072#1085#1089
        DataBinding.FieldName = 'BALANCE_PREV'
        Width = 65
      end
      object tvPodotchKOMMENT: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090'.'
        DataBinding.FieldName = 'KOMMENT'
        Width = 53
      end
    end
    object dbgClientsLevel1: TcxGridLevel
      GridView = tvPodotch
    end
  end
  object ToolBar1: TToolBar [3]
    Left = 0
    Top = 45
    Width = 998
    Height = 29
    ButtonHeight = 26
    Caption = 'ToolBar1'
    Images = DMInv.ilActive
    TabOrder = 3
    object tbMoneyTransfer: TToolButton
      Left = 0
      Top = 2
      Hint = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075
      Caption = 'tbMoneyTransfer'
      ImageIndex = 17
      ParentShowHint = False
      ShowHint = True
      OnClick = tbMoneyTransferClick
    end
    object tbPrint: TToolButton
      Left = 23
      Top = 2
      Hint = #1055#1086#1076#1086#1090#1095#1077#1090#1099
      Caption = 'tbPrint'
      ImageIndex = 11
      ParentShowHint = False
      ShowHint = True
      OnClick = tbPrintClick
    end
    object ToolButton1: TToolButton
      Left = 46
      Top = 2
      Width = 8
      Caption = 'ToolButton1'
      ImageIndex = 12
      Style = tbsSeparator
    end
    object Label1: TLabel
      Left = 54
      Top = 2
      Width = 43
      Height = 26
      Alignment = taCenter
      AutoSize = False
      Caption = #1044#1072#1090#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object ePodotchDate: TcxButtonEdit
      Tag = 11
      Left = 97
      Top = 3
      ParentFont = False
      Properties.Buttons = <
        item
          Glyph.Data = {
            F6000000424DF600000000000000760000002800000010000000100000000100
            0400000000008000000000000000000000001000000000000000000000000000
            8000008000000080800080000000800080008080000080808000C0C0C0000000
            FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFF0FFFFFFFFFFFFFF000FFFFFFFFFFFF00000FFFFFFFFFF0000000F
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
        end>
      Properties.MaxLength = 0
      Properties.ReadOnly = True
      Properties.OnButtonClick = ePaymentDatePropertiesButtonClick
      Properties.OnChange = ePodotchDatePropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.LookAndFeel.SkinName = ''
      Style.Shadow = False
      Style.IsFontAssigned = True
      StyleDisabled.LookAndFeel.SkinName = ''
      StyleFocused.LookAndFeel.SkinName = ''
      StyleHot.LookAndFeel.SkinName = ''
      TabOrder = 0
      Width = 211
    end
    object ToolButton2: TToolButton
      Left = 308
      Top = 2
      Width = 8
      Caption = 'ToolButton2'
      ImageIndex = 13
      Style = tbsSeparator
    end
    object Label7: TLabel
      Left = 316
      Top = 2
      Width = 85
      Height = 26
      Alignment = taCenter
      AutoSize = False
      Caption = #1055#1086#1076#1086#1090#1095'. '#1083#1080#1094#1086
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxLookupComboBox1: TcxLookupComboBox
      Left = 401
      Top = 2
      ParentFont = False
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'FIO'
        end>
      Properties.ListSource = dsPodotchLitso
      Properties.OnChange = cxLookupComboBox1PropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 1
      Width = 209
    end
  end
  object cxSplitter1: TcxSplitter [4]
    Left = 0
    Top = 538
    Width = 998
    Height = 8
    AlignSplitter = salTop
    Control = dbgClients
  end
  object cxGrid1: TcxGrid [5]
    Left = 0
    Top = 546
    Width = 998
    Height = 144
    Align = alTop
    TabOrder = 5
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView1: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dsRPS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'RPSSUMMA'
          Column = cxGridDBTableView1RPSSUMMA
          DisplayText = #1054#1073#1097'. '#1089#1091#1084#1084#1072
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
      NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.CellSelect = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView1PU: TcxGridDBColumn
        Caption = #1055#1086#1083#1091#1095'. '#1091#1089#1083#1091#1075
        DataBinding.FieldName = 'PU'
        Width = 295
      end
      object cxGridDBTableView1STNAME: TcxGridDBColumn
        Caption = #1059#1089#1083#1091#1075#1072
        DataBinding.FieldName = 'STNAME'
        Width = 293
      end
      object cxGridDBTableView1RPSSUMMA: TcxGridDBColumn
        Caption = #1057#1091#1084#1084#1072', '#1088#1091#1073
        DataBinding.FieldName = 'RPSSUMMA'
        Width = 82
      end
    end
    object cxGridLevel1: TcxGridLevel
      GridView = cxGridDBTableView1
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qCommon
  end
  object qCommon: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT RP.RPID, RP.RPDATE, RP.RPTIMEENTER,'
      '    CASE RP.PPID'
      '    WHEN 1 THEN '#39#1041#1072#1085#1082#39
      
        '    WHEN 2 THEN P1.PLASTNAME||'#39' '#39'||SUBSTRING(P1.PNAME FROM 1 FOR' +
        ' 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39 +
        ')'
      
        '    WHEN 3 THEN P1.PLASTNAME||'#39' '#39'||SUBSTRING(P1.PNAME FROM 1 FOR' +
        ' 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39 +
        ')'
      
        '    ELSE P.PLASTNAME||'#39' '#39'||SUBSTRING(P.PNAME FROM 1 FOR 1 )||'#39'. ' +
        #39'||'
      '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')'
      '    END AS fio,'
      
        '        RP.RPSUMMA AS debet, CAST('#39'0'#39' AS NUMERIC(18,2)) AS kredi' +
        't,  '#39#1044#1077#1073#1077#1090#39' AS type_oper,'
      '        ('
      'SELECT SUM(balance1.sum_)'
      'FROM'
      '('
      'SELECT COALESCE(SUM(RP1.RPSUMMA),0) AS sum_'
      'FROM RASPRED_PODOTCH RP1'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP1.PPID_TO'
      'WHERE RP1.RPID <= RP.RPID'
      '    AND RP1.RPTYPE = 0'
      '    AND RP1.RPISDELETE IS NULL'
      '    AND PP1.PP_ID = :PID'
      'UNION'
      'SELECT COALESCE(SUM(RP1.RPSUMMA)*(-1),0) AS sum_'
      'FROM RASPRED_PODOTCH RP1'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP1.PPID'
      'WHERE RP1.RPID <= RP.RPID'
      '    AND RP1.RPTYPE = 1'
      '    AND RP1.RPISDELETE IS NULL'
      '    AND PP1.PP_ID = :PID'
      ') AS balance1'
      
        '        ) AS balance_prev, RP.RPSUMMA AS balance, COALESCE(RP.RP' +
        'NOTE, CS.CSNOTE) AS komment'
      'FROM RASPRED_PODOTCH RP'
      'LEFT OUTER JOIN PERSON_PODOTCH PP ON PP.PPID = RP.PPID_TO'
      'LEFT OUTER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP.PPID'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = PP1.PP_ID'
      'LEFT OUTER JOIN COMMON_SERV CS ON CS.CSID =  RP.CSID'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = CS.PID_POLUCH'
      'WHERE PP.PP_ID = :PID  AND RP.RPISDELETE IS NULL'
      '    AND RP.RPTYPE = 0'
      
        '    AND CAST(RP.RPTIMEENTER AS DATE) BETWEEN :datebegin AND :dat' +
        'eend'
      'UNION'
      'SELECT RP.RPID, RP.RPDATE, RP.RPTIMEENTER,'
      '    CASE RP.PPID_TO'
      '    WHEN 1 THEN '#39#1041#1072#1085#1082#39
      
        '    WHEN 2 THEN P1.PLASTNAME||'#39' '#39'||SUBSTRING(P1.PNAME FROM 1 FOR' +
        ' 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39 +
        ')'
      
        '    WHEN 3 THEN P1.PLASTNAME||'#39' '#39'||SUBSTRING(P1.PNAME FROM 1 FOR' +
        ' 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39 +
        ')'
      
        '    ELSE P.PLASTNAME||'#39' '#39'||SUBSTRING(P.PNAME FROM 1 FOR 1 )||'#39'. ' +
        #39'||'
      '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')'
      '    END AS fio,'
      
        '        CAST('#39'0'#39' AS NUMERIC(18,2)) AS debet, RP.RPSUMMA  AS kred' +
        'it, '#39#1050#1088#1077#1076#1080#1090#39' AS type_oper,'
      '        ('
      'SELECT SUM(balance1.sum_)'
      'FROM'
      '('
      'SELECT COALESCE(SUM(RP1.RPSUMMA),0) AS sum_'
      'FROM RASPRED_PODOTCH RP1'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP1.PPID_TO'
      'WHERE RP1.RPID <= RP.RPID'
      '    AND RP1.RPTYPE = 0'
      '    AND RP1.RPISDELETE IS NULL'
      '    AND PP1.PP_ID = :PID'
      'UNION'
      'SELECT COALESCE(SUM(RP1.RPSUMMA)*(-1),0) AS sum_'
      'FROM RASPRED_PODOTCH RP1'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP1.PPID'
      'WHERE RP1.RPID <= RP.RPID'
      '    AND RP1.RPTYPE = 1'
      '    AND RP1.RPISDELETE IS NULL'
      '    AND PP1.PP_ID = :PID'
      ') AS balance1'
      
        '        ) AS balance_prev, ((-1) * RP.RPSUMMA) AS balance, RP.RP' +
        'NOTE AS komment'
      'FROM RASPRED_PODOTCH RP'
      'LEFT OUTER JOIN PERSON_PODOTCH PP ON PP.PPID = RP.PPID'
      'LEFT OUTER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP.PPID_TO'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = PP1.PP_ID'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = RP.CSID'
      'WHERE PP.PP_ID = :PID  AND RP.RPISDELETE IS NULL'
      '    AND RP.RPTYPE = 1'
      'AND CAST(RP.RPTIMEENTER AS DATE) BETWEEN :datebegin AND :dateend')
    Left = 280
    Top = 1
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'datebegin'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'dateend'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'datebegin'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'dateend'
        ParamType = ptUnknown
      end>
    object qCommonFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qCommonRPDATE: TDateField
      FieldName = 'RPDATE'
      Origin = '"RASPRED_PODOTCH"."RPDATE"'
    end
    object qCommonDEBET: TIBBCDField
      FieldName = 'DEBET'
      Origin = '"RASPRED_PODOTCH"."RPSUMMA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonKREDIT: TIBBCDField
      FieldName = 'KREDIT'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonTYPE_OPER: TIBStringField
      FieldName = 'TYPE_OPER'
      ProviderFlags = []
      FixedChar = True
      Size = 6
    end
    object qCommonBALANCE: TIBBCDField
      FieldName = 'BALANCE'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonBALANCE_PREV: TIBBCDField
      FieldName = 'BALANCE_PREV'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonRPTIMEENTER: TDateTimeField
      FieldName = 'RPTIMEENTER'
      Origin = '"RASPRED_PODOTCH"."RPTIMEENTER"'
    end
    object qCommonKOMMENT: TIBStringField
      FieldName = 'KOMMENT'
      ProviderFlags = []
      Size = 255
    end
    object qCommonRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RASPRED_PODOTCH"."RPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
  object RvSystem1: TRvSystem
    TitleSetup = 'Output Options'
    TitleStatus = #1057#1090#1072#1090#1091#1089
    TitlePreview = 'Report Preview'
    SystemSetups = [ssAllowCopies, ssAllowCollate, ssAllowDuplex, ssAllowDestPreview, ssAllowDestPrinter, ssAllowDestFile, ssAllowPrinterSetup, ssAllowPreviewSetup]
    SystemFiler.StatusFormat = #1060#1086#1088#1084#1080#1088#1091#1102' '#1089#1090#1088#1072#1085#1080#1094#1091' %p'
    SystemPreview.FormState = wsMaximized
    SystemPreview.ShadowDepth = 5
    SystemPreview.ZoomFactor = 100.000000000000000000
    SystemPreview.ZoomInc = 25
    SystemPrinter.ScaleX = 100.000000000000000000
    SystemPrinter.ScaleY = 100.000000000000000000
    SystemPrinter.StatusFormat = 'Printing page %p'
    SystemPrinter.Title = 'ReportPrinter Report'
    SystemPrinter.Units = unMM
    SystemPrinter.UnitsFactor = 25.400000000000000000
    Left = 360
    Top = 8
  end
  object RvProject1: TRvProject
    Engine = RvSystem1
    ProjectFile = 'Kassa_new.rav'
    Left = 392
    Top = 8
  end
  object rvdsPered_podotch: TRvDataSetConnection
    LocalFilter = False
    RuntimeVisibility = rtEndUser
    DataSet = qCommon
    Left = 424
    Top = 8
  end
  object dsRPS: TDataSource
    DataSet = qRPS
    Left = 272
    Top = 464
  end
  object qRPS: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT IIF(RPS.CTYPE = 2,'#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080#1077' '#1076#1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073 +
        #1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39', ST.STNAME) AS STNAME,'
      'RPS.RPSSUMMA,'
      '(p1.PLASTNAME||'#39' '#39'||SUBSTRING(p1.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      'COALESCE(SUBSTRING(p1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) AS pu'
      'FROM RP_SERVICES RPS'
      'INNER JOIN RASPRED_PODOTCH RP ON RP.RPID = RPS.RPID'
      'INNER JOIN SERVICES S ON S.SID = RPS.SID'
      'INNER JOIN COMMON_SERV CS ON CS.CSID = RP.CSID'
      'INNER JOIN PEOPLE P1 ON P1.PID = CS.PID_POLUCH'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE RPS.RPID = :RPID AND (NOT RP.PPID_TO IN (1,2))'
      'UNION'
      
        'SELECT IIF(RPS.CTYPE = 2,'#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080#1077' '#1076#1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073 +
        #1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39', ST.STNAME) AS STNAME,'
      'RPS.RPSSUMMA,'
      '(p1.PLASTNAME||'#39' '#39'||SUBSTRING(p1.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      'COALESCE(SUBSTRING(p1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) AS pu'
      'FROM RP_SERVICES RPS'
      'INNER JOIN RASPRED_PODOTCH RP ON RP.RPID = RPS.RPID'
      'INNER JOIN SERVICES S ON S.SID = RPS.SID'
      'INNER JOIN PEOPLE P1 ON P1.PID = RP.CSID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE RPS.RPID = :RPID AND (RP.PPID_TO IN (1,2))')
    Left = 312
    Top = 465
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RPID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'RPID'
        ParamType = ptUnknown
      end>
    object qRPSSTNAME: TIBStringField
      FieldName = 'STNAME'
      ProviderFlags = []
      Size = 255
    end
    object qRPSRPSSUMMA: TIBBCDField
      FieldName = 'RPSSUMMA'
      Origin = '"RP_SERVICES"."RPSSUMMA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRPSPU: TIBStringField
      FieldName = 'PU'
      ProviderFlags = []
      Size = 769
    end
  end
  object dsPodotchLitso: TDataSource
    DataSet = qPodotchLitso
    Left = 456
    Top = 45
  end
  object qPodotchLitso: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      '--'#1095#1077#1083#1086#1074#1077#1082#1080
      
        'SELECT P.PID, P.PID as USERMONEY, PP.PPID, P.PLASTNAME||'#39' '#39'||SUB' +
        'STRING(P.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')' +
        ' AS fio'
      'FROM  PERSON_PODOTCH PP'
      'INNER JOIN PEOPLE P ON P.PID = PP.PP_ID'
      'WHERE PP.PPTYPE = 4')
    GeneratorField.Field = 'RPID'
    Left = 488
    Top = 45
    object qPodotchLitsoPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qPodotchLitsoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoUSERMONEY: TIntegerField
      FieldName = 'USERMONEY'
      Origin = '"PEOPLE"."PID"'
      Required = True
    end
  end
end
